Imports System.Collections.Generic

Imports System.Web

#Region "using"
Imports System.Data
Imports QUANLY.DAO
Imports QUANLY.DTO
#End Region
Public Class CHITIET_PHIEUDATTOURBUS
	Private objDAO As CHITIET_PHIEUDATTOURDAO
	Public Sub New(strPath As [String])
		objDAO = New CHITIET_PHIEUDATTOURDAO(strPath)
	End Sub

	Public Function SelectAll() As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectAll()
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function SelectByID(id As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByID(id)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function Insert(obj As CHITIET_PHIEUDATTOURDTO) As Boolean
		Try
			Return objDAO.Insert(obj)
		Catch
			Return False
		End Try
	End Function

	Public Function Delete(id As Integer) As Boolean
		Try
			Return objDAO.Delete(id)
		Catch
			Return False
		End Try
	End Function

    Public Function DeleteByIDPhieuDatTour(ByVal id As Integer) As Boolean
        Try
            Return objDAO.DeleteByIDPhieuDatTour(id)
        Catch
            Return False
        End Try
    End Function

	Public Function Update(obj As CHITIET_PHIEUDATTOURDTO) As Boolean
		Try
            Return objDAO.Update(obj)
		Catch
			Return False
		End Try
	End Function

	Public Function SelectByIDPhieuDatTour(idphieudattour As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByIDPhieuDatTour(idphieudattour)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function SelectByIDKhachHang(idkhachhang As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByIDKhachHang(idkhachhang)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

End Class
